package com.csgsystems.im.module.action.example;

import java.util.Arrays;
import java.util.List;
import java.util.Set;

import com.csgsystems.im.struts2.action.BaseActionSupport;
import com.csgsystems.im.survey.Category;
import com.csgsystems.im.survey.Question;
import com.csgsystems.im.survey.SurveyStatus;
import com.csgsystems.im.survey.SurveyType;
import com.csgsystems.im.survey.persistence.LanguageDao;
import com.csgsystems.im.survey.persistence.QuestionDao;
import com.csgsystems.im.survey.persistence.SurveyDao;

@SuppressWarnings("serial")
public abstract class ExampleBaseAction extends BaseActionSupport {

	SurveyDao surveyDao = null;
	QuestionDao questionDao = null;
	LanguageDao languageDao = null;

	String name = null;
	Category category = Category.Web;
	long hierarchyItemId = 847;
	String vxml = null;
	int numberOfQuestions = 0;
	int voiceRecording = 0;
	SurveyStatus status = SurveyStatus.Inactive;
	SurveyType type = SurveyType.Web;
//	QuestionTypeId questionTypeId = QuestionTypeId.YesNo;
//	LanguageTypeId languageId = LanguageTypeId.English;
	double weight = 1.0;
	long questionId = 1;
	String questionText = null;

	boolean resultFollowup = false;
	boolean displayResultAverage = false;
	
	Set<Question> questions = null;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<Category> getCategoryList() {
		return Arrays.asList(Category.values());
	}

//	public List<QuestionTypeId> getQuestionTypeIdList() {
//		return Arrays.asList(QuestionTypeId.values());
//	}
//	
//	public List<LanguageTypeId> getLanguageTypeIdList() {
//		return Arrays.asList(LanguageTypeId.values());
//	}
	public int getCategory() {
		return category.getId();
	}

	public void setCategory(int category) {
		this.category = Category.valueOf(category);
	}

//	public int getQuestionTypeId() {
//		return questionTypeId.getId();
//	}
//
//	public void setQuestionTypeId(int questionTypeId) {
//		this.questionTypeId = QuestionTypeId.valueOf(questionTypeId);
//	}
//
//	public int getLanguageId() {
//		return languageId.getId();
//	}
//
//	public void setLanguageId(int languageId) {
//		this.languageId = LanguageTypeId.valueOf(languageId);
//	}
//	
	public long getHierarchyItemId() {
		return hierarchyItemId;
	}

	public void setHierarchyItemId(long hierarchyItemId) {
		this.hierarchyItemId = hierarchyItemId;
	}

	public long getQuestionId() {
		return questionId;
	}

	public void setQuestionId(long questionId) {
		this.questionId = questionId;
	}

	public String getVxml() {
		return vxml;
	}

	public void setVxml(String vxml) {
		this.vxml = vxml;
	}

	public int getNumberOfQuestions() {
		return numberOfQuestions;
	}

	public void setNumberOfQuestions(int numberOfQuestions) {
		this.numberOfQuestions = numberOfQuestions;
	}

	public double getWeight() {
		return weight;
	}

	public void setWeight(double weight) {
		this.weight = weight;
	}

	public String getQuestionText() {
		return questionText;
	}

	public void setQuestionText(String questionText) {
		this.questionText = questionText;
	}

	public int getVoiceRecording() {
		return voiceRecording;
	}

	public void setVoiceRecording(int voiceRecording) {
		this.voiceRecording = voiceRecording;
	}

	public List<SurveyStatus> getSurveyStatusList() {
		return Arrays.asList(SurveyStatus.values());
	}

	public String getStatus() {
		return status.toString();
	}

	public void setStatus(String status) {
		this.status = SurveyStatus.valueOf(status);
	}

	public List<SurveyType> getSurveyTypeList() {
		return Arrays.asList(SurveyType.values());
	}

	public String getType() {
		return type.toString();
	}

	public void setType(String type) {
		this.type = SurveyType.valueOf(type);
	}

	public boolean isResultFollowup() {
		return resultFollowup;
	}

	public void setResultFollowup(boolean resultFollowup) {
		this.resultFollowup = resultFollowup;
	}

	public boolean isDisplayResultAverage() {
		return displayResultAverage;
	}

	public void setDisplayResultAverage(boolean displayResultAverage) {
		this.displayResultAverage = displayResultAverage;
	}

	public Set<Question> getQuestions() {
		return questions;
	}

	public SurveyDao getSurveyDao() {
		return surveyDao;
	}

	public void setSurveyDao(SurveyDao surveyDao) {
		this.surveyDao = surveyDao;
	}

	public LanguageDao getLanguageDao() {
		return languageDao;
	}

	public void setLanguageDao(LanguageDao languageDao) {
		this.languageDao = languageDao;
	}

}
